﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NppPluginNET.Forms
{
    public partial class frmHighlight : Form
    {

        private List<float> _markerLocations = new List<float>();
        private float _viewportTop = 0;
        private float _viewportHeight = 0;

        /* Set of lines that exist at the markers in _markerLocations that were used at last Paint */
        private List<Control> _currentMarkers = new List<Control>();


        public frmHighlight()
        {
            InitializeComponent();
        }

        public UInt32 CountWordStylesUpdated
        {
            set
            {
                this.lblCntWordStyleUpdated.Text = value.ToString();
            }
        }

        public bool NppReady
        {
            set
            {
                this.lblNppReady.Text = value.ToString();
            }
        }

        public uint ViewportStart
        {
            set
            {
                lblViewportStart.Text = value.ToString();
            }
        }

        public uint ViewportLength
        {
            set
            {
                lblViewportLength.Text = value.ToString();
            }
        }

        public uint LineCount
        {
            set
            {
                lblLineCount.Text = value.ToString();
            }
        }

        private void frmHighlight_Resize(object sender, EventArgs e)
        {
            PluginBase.updateDialog();
        }

        public void SetViewport(float top, float height)
        {

            this._viewportTop = top;
            this._viewportHeight = height;


            lblTheViewport.Text = "";
            

            lblTheViewport.Left = 0;
            lblTheViewport.Width = this.ClientSize.Width;


            lblTheViewport.Top = (int)((float)this.ClientSize.Height * this._viewportTop);
            lblTheViewport.Height = (int)((float)this.ClientSize.Height * this._viewportHeight);

        }

        public void SetHighlightMarkers(List<float> markers)
        {
            this._markerLocations = markers;
        }

        

    }
}
